home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / aplictns / dtc / part04 < prev    next >
Encoding:
Internet Message Format  |  1990-03-14  |  40.5 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i110: DTC - desktop calendar, Part04/06
  5. Message-ID: <11789@xanth.cs.odu.edu>
  6. Date: 14 Mar 90 01:33:10 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  9. Lines: 1546
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: "Glenn Everhart: 215 354 7610 (8*747 7610)" <EVERHART@ARISIA.dnet.ge.com>
  15. Posting-number: Volume 90, Issue 110
  16. Archive-name: applications/dtc/part04
  17.  
  18. #!/bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 4 (of 6)."
  25. # Contents:  Dtc.For.ab
  26. # Wrapped by tadguy@xanth on Tue Mar 13 20:29:25 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Dtc.For.ab' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'Dtc.For.ab'\"
  30. else
  31. echo shar: Extracting \"'Dtc.For.ab'\" \(37896 characters\)
  32. sed "s/^X//" >'Dtc.For.ab' <<'END_OF_FILE'
  33. X      Data daylist / '   Sun', '   Mon', '  Tues',
  34. X     1 'Wednes', ' Thurs', '   Fri', ' Satur' /
  35. X      Data mthlist
  36. X     1 /'  January', ' February', '    March', '    April',
  37. X     2  '      May', '     June', '     July', '   August',
  38. X     3  'September', '  October', ' November', ' December'/
  39. X
  40. X
  41. X      include stmtfunc.for
  42. X
  43. Xc       Initialize:
  44. X
  45. X      dupl = '##'
  46. XC Init for duplicate check
  47. X
  48. Xc leave = or *
  49. X      if ((ln1 .and. ucmask) .eq. ichar('D'))
  50. X     1    call shrink(1, ifnb, lnb)
  51. X
  52. X      call dtcdatcvt(3)
  53. XC Pick off a date value
  54. X
  55. X      im=idmo
  56. X      id=iddy
  57. X      iye=ibigyr
  58. X      call dtcalcdow (isx, imx, im, iye)
  59. XC Get day-of-week for B/O/M
  60. X
  61. X      idx = mod (id + isx - 2, 7) + 1
  62. XC Calc current d/o/w
  63. X
  64. X      call dtcidate(imr, idr, iyr)
  65. XC Get today's date
  66. X
  67. XC if current = today,
  68. XC flag current time
  69. X      if ((im .eq. imr) .and.
  70. X     1   (id .eq. idr) .and.
  71. X     2   (iye .eq. iyr)) then
  72. XC Displaying current day
  73. X          Call time(iscnds)
  74. X          scnds=iscnds
  75. X          scnds = amax1(scnds, 28801.)
  76. XC Get current time (>8 AM)
  77. X          ihalf = mod(ifix(scnds/1800.), 48)
  78. XC current half-hour (orig 0)
  79. X          ihour = ihalf/2
  80. XC       Current hour
  81. X          ihalf = ihalf - (ihour*2)
  82. XC       0 or 1 for half-hour
  83. X
  84. X       else
  85. X          ihour = 0
  86. XC       Set non-match value
  87. X      endif
  88. X
  89. Xc ************************** Move the cursor to top of screen and clear it,
  90. Xc ************************** set up appointments display:
  91. X    Rewind iterm
  92. X      write(iterm,4) esc,homescrn, esc,clrscrn
  93. X 4      format($, 4a, $)
  94. X
  95. X      write(iterm,5,err=598) 
  96. X     1 daylist(idx), mthlist(im), id, ibigyr
  97. X 5      format(1x,'Schedule - ', a6,'day, ', a9, i3, ',', i5)
  98. Xc      write(iterm,5) ' ', esc,dhdw2,
  99. Xc     1 daylist(idx), mthlist(im), id, ibigyr
  100. X598     continue
  101. X
  102. X      Do (i=8,16)
  103. X          If ( i .gt. 12 ) then
  104. X        j = i - 12
  105. X          Else
  106. X        j = i
  107. X          End If
  108. X
  109. X          if (i .ne. ihour) then
  110. XC Check for highlighting
  111. X        write(iterm,6) j
  112. X        write(iterm,7) j
  113. X          else
  114. XC must be current hour
  115. X        if (ihalf .eq. 0) then
  116. XC Check which half
  117. X            write(iterm,96) esc,revattr, j, esc,resetvattr
  118. X            write(iterm,7) j
  119. X        else
  120. X            write(iterm,6) j
  121. X            write(iterm,97) esc,revattr, j, esc,resetvattr
  122. X        endif
  123. X
  124. X          endif
  125. X      end do
  126. X
  127. X 6      format(1x,i2,':00   -')
  128. X 7      format(1x,i2,':30   -')
  129. X 96     format (2x, 2a, i2,':00', 2a, '   -')
  130. X 97     format (2x, 2a, i2,':30', 2a, '   -')
  131. X
  132. X      if (ihour .ge. 17) then
  133. XC Highlight 'Evening' line
  134. X          write(iterm,98) esc,revattr, esc,resetvattr
  135. X      else
  136. XC Includes display other than today
  137. X          write(iterm,9)
  138. X      end if
  139. X
  140. X 9      format(1x, 'Evening -', /, x, 75('='))
  141. X 98     format(1x, 2a, ' Evening', 2a, ' -', /, x, 75('='))
  142. X
  143. Xc ******************* Screen has now been displayed,
  144. Xc ******************* now check rest of line for time and appointment
  145. X
  146. X      if (ln1 .ne. 0) then
  147. XC More characters available?
  148. X
  149. X          iht = 80
  150. XC Default is 8:00
  151. X          ihmx = iht
  152. XC (only 1 entry)
  153. X          call dtctimcvt(iht, ihmx)
  154. XC Decode time value if present
  155. X
  156. X          ihh1 = (iht+2)/5
  157. XC Adds 1 if trailing 3
  158. X          ihh2 = (ihmx+2)/5
  159. XC Result is 16 to 35
  160. X          idmx = min0(max0(ihh2-ihh1, 1), 20)
  161. XC 8:00>6:00
  162. X          iht = min0(iht,173)
  163. XC Limit entry time (DTCTIMCVT lim is 180)
  164. X
  165. Xc Note: range of h1:00>h1:30 is considered only one scheduling interval,
  166. Xc similarly h(1)>h(2) is an even number, ending just before h(2),
  167. Xc computation forces at least one for interval h1:00>h1:00
  168. X
  169. X          ifnb = 0
  170. X          lnb = 0
  171. X          ivx = 0
  172. X          ap1 = 0
  173. XC Clear appointment string
  174. X
  175. X          do (i = 1, icmln)
  176. X
  177. X        ll = line(i)
  178. X        appnt(i) = ll
  179. X
  180. X        if (ll .eq. 0) go to 6789
  181. XC done
  182. X
  183. X        ivx = i
  184. XC Save current length
  185. X
  186. X          end do
  187. X
  188. Xc               Was there an appointment string input?
  189. Xc               If so, put it in file, and display it on screen.
  190. Xc               If not, move cursor to correct time on screen,
  191. Xc               then input the appointment, put in file and re-display it.
  192. X
  193. X 6789       If (ap1 .eq. 0) then
  194. XC Empty appointment string
  195. X
  196. X        iy = ihh1 - 13
  197. XC Vertical position for half hour
  198. Xc amiga fixup ... iy is 1 less
  199. X        iy = iy-1
  200. Xc end amiga fixup...
  201. X        ix = 11
  202. X        call dtcat(ix,iy)
  203. X        ibsp=8
  204. X        write(iterm, 987) blot,ibsp
  205. XC write blot, backspace
  206. X 987            format ($, 2a1, $)
  207. X    Rewind iterm
  208. X    Rewind 7
  209. X        read(7,13,END=914,err=914) workstr
  210. X    Rewind 7
  211. X 13             format(a)
  212. X      do 305 nnn=1,80
  213. X      lapp=81-nnn
  214. X      if(workstr(lapp:lapp).gt.char(32))goto 306
  215. X      workstr(laPP:LAPP)=char(0)
  216. X305   continue
  217. X306   continue
  218. Xc copy appointment for use later...
  219. X
  220. X        ifnb = 0
  221. X        lnb = 0
  222. X        ivx = 0
  223. X
  224. X        Do (i = 1, lapp)
  225. X
  226. X            ll = work(i)
  227. XC fetch character
  228. X
  229. X            if (ll .gt. 32) then
  230. X                if (ifnb .eq. 0) ifnb = i
  231. XC Flag first non-blank
  232. X                lnb = i
  233. XC Flag last non-blank
  234. X
  235. X            end if
  236. X
  237. X            if (ifnb .ne. 0) then
  238. XC Copy after first n/b
  239. X                ivx = ivx + 1
  240. X                appnt(ivx) = ll
  241. X            end if
  242. X
  243. X        end do
  244. X
  245. X        if (ifnb .eq. 0) go to 914
  246. XC Nothing on read either
  247. X
  248. X          End If
  249. X
  250. X          ivx = min0(ivx, iaptlim)
  251. XC ivx = length of string
  252. X
  253. XC  If we are using the 'S' command, add meetings to the indirected files ONLY,
  254. XC  not to the current (control) file.
  255. X
  256. X          if (ctlfg .ne. 1) then
  257. XC Add appointment if D or G
  258. X
  259. X        close (1)
  260. XC Insurance
  261. X        Open ( unit=1,file=FNc(1:fnsz)
  262. X     1  ,status='UNKNOWN',form='FORMATTED',
  263. X     1  position='append',err=9876)
  264. X
  265. X        ihtxx=iht
  266. X        do (ixx = 1, idmx)
  267. X
  268. X            write(1,14,err=597) iye,im,id,ihtxx,apstr(1:ivx)
  269. X597    Continue
  270. X            if ((ihtxx/10)*10 .eq. ihtxx)
  271. X     1        then
  272. X
  273. X                ihtxx=ihtxx+3
  274. XC IHT is even hour, go to next half hour
  275. X
  276. X              else
  277. X
  278. X                ihtxx=ihtxx+7
  279. XC IHT is a half hour ... make up to next hour
  280. X
  281. X            end if
  282. X
  283. X        end do
  284. X
  285. X 14             format(i4.4,2i2.2,i3.3,x,a)
  286. X
  287. X 9876           close(1)
  288. X
  289. X          End If
  290. X
  291. X      else
  292. XC Empty line (no appointment to add)
  293. X 914        idmx = 0
  294. XC Use as flag for display only
  295. X
  296. X      end if
  297. X
  298. X      eofflg = -1
  299. XC Request OPEN
  300. X      prveof = 0
  301. XC Set for DO WHILE
  302. X
  303. X      lookind = 0
  304. X      if (ctlfg .ne. 0) lookind = 1
  305. XC Set for looking at filenames
  306. X
  307. X      irqhash(1) = ihymd(iye, im, id)
  308. XC Set match for file scan
  309. X      irqhash(2) = irqhash(1)
  310. XC One day only
  311. X      IHTsav=IHT
  312. Xc Iht clobbered by dtcrdappt
  313. X      do while (prveof .ge. 0)
  314. X
  315. X         call dtcrdappt(eofflg, lookind)
  316. X
  317. X          if (eofflg .eq. 1)
  318. X     1     then
  319. XC Returned with filename string
  320. X
  321. Xc on scheduling multiple dates via S or G functions, use this occasion to
  322. Xc add the record to everyone's calendar file.
  323. X
  324. X        close(2)
  325. X        Do (nnn=1,90)
  326. X        nnm=101-nnn
  327. X        If(Workstr(nnm:nnm).ge.char(32))Goto 963
  328. Xc find last nonblank char in string
  329. X        End Do
  330. X963     Continue
  331. X        Open (unit=2, file=workstr(istart:nnm), status='UNKNOWN',
  332. X     1      form='FORMATTED',
  333. X     2      position='APPEND', err=1119)
  334. X
  335. Xc        ihtxx=iht
  336. X        ihtxx=ihtsav
  337. X        do (ixx = 1, idmx)
  338. X            write(2,14,err=596)iye,im,id,ihtxx,apstr(1:ivx)
  339. X596     Continue
  340. X            if ((ihtxx/10)*10 .eq. ihtxx) then
  341. X                ihtxx=ihtxx+3
  342. XC iht is an even hour ... add the half hour
  343. X            else
  344. X                ihtxx=ihtxx+7
  345. XC iht is a half hour ... make up to next hour
  346. X            end if
  347. X
  348. X        end do
  349. X
  350. X 1119           close(2)
  351. X
  352. Xc Display appointment if it matches current date
  353. X
  354. X          else If (eofflg .eq. 0)
  355. X     1     then
  356. X
  357. X        iy = min0(max0((((iht+2) / 5) - 13), 3), 22)
  358. X
  359. Xc  Amiga fixup -- iy is 1 less
  360. X        iy=iy-1
  361. Xc end Amiga fixup
  362. X
  363. XC Compute vertical posn
  364. XC Have we been here before
  365. X        if (dupb(iy) .eq. 32)
  366. X     1    then
  367. XC No
  368. X            dupb(iy) = '-'
  369. XC Flag it
  370. X          else
  371. XC Duplicate time stamps, find substitute
  372. X            do (ix = iy-1, 3, -1)
  373. XC Search backward first
  374. X                if (dupb(ix) .eq. 32)
  375. X     1            then
  376. X                    iy = ix
  377. XC Save replacement
  378. X                    dupb(iy) = 'v'
  379. XC Point to where it should go
  380. X                    go to 3141
  381. XC >>> BREAK <<<
  382. X                end if
  383. X            end do
  384. X            do (ix = iy + 1, 22)
  385. XC Search forward
  386. X                if (dupb(ix) .eq. 32)
  387. X     1            then
  388. X                    iy = ix
  389. XC Save replacement
  390. X                    dupb(iy) = '^'
  391. XC Point to where it should go
  392. X                    go to 3141
  393. XC >>> BREAK <<<
  394. X                end if
  395. X            end do
  396. X            dupb(iy) = blot
  397. XC Flag it
  398. X        end if
  399. X
  400. X 3141           ix = 2
  401. XC first char to print
  402. X        if (appoin(1) .ne. 32)
  403. X     1    then
  404. X            ix = 1
  405. XC '12:00   - Appointment'
  406. X          else
  407. X            if (iaptln .le. 1)
  408. X     1       then
  409. X                appoin(2) = blot
  410. XC Display BLOT for empty entry
  411. X                iaptln = 2
  412. X            end if
  413. X        end if
  414. X
  415. X        kk = min0(iaptln, iaptlim)
  416. X
  417. X        call dtcat(8,iy)
  418. XC Set cursor position
  419. X
  420. XC flag + text
  421. X        write(iterm,300) dupb(iy), ' ', apptstr(ix:kk),
  422. X     1      esc,'[K'
  423. XC Erase EOL
  424. X 300            format($, 5a, $)
  425. X
  426. X          End If
  427. XC eofflg .ge. 0
  428. X
  429. X          prveof = eofflg
  430. XC Show what happened
  431. X
  432. X      end do
  433. XC while (prveof)
  434. X      write(iterm,367)
  435. X367    format('  ')
  436. Xd      write(4,4203)
  437. Xd4203  format(' Day .. returning')
  438. Xd      call dely
  439. X      call dtcat(1,22)
  440. X      Return
  441. X      end
  442. XC -h- month.for   Tue Jul  8 16:05:05 1986
  443. Xc-----------------------------------------------------------------------
  444. XC       Month-at-a-glance subroutine
  445. XC       part of Mitch Wyle's DTC program
  446. XC       Input:
  447. Xc               line    -       72 INTEGER*1 string;  Format: M [dd[19[yy]]]
  448. XC       Output:
  449. Xc               display screen (see below)
  450. XC  Line
  451. Xc     1 Prevmonth                       Nextmonth
  452. Xc     2 SMTWTFS                           SMTWTFS
  453. XC   3-8 Calendar                         Calendar
  454. Xc  9/10 Y e a r         M o n t h         Y e a r
  455. Xc    11               S M T W T F S
  456. Xc 13-23              C a l e n d a r
  457. XC Lines 9/10 are double-height/double-width
  458. Xc Odd lines 11-23 are double-width
  459. Xc Even lines 10-22 are blank
  460. XC-----------------------------------------------------------------------
  461. XC       Modified 850318, several changes- CG
  462. Xc               Display today's date in current, prev or next month
  463. Xc                 in reverse video
  464. Xc               Write out >>> only <<< non-blank flags (*'s)
  465. Xc               Speed-up of month display (actually in dtcdspmth subr)
  466. Xc               Months mixed-case and centered (GABY)
  467. Xc       Modified 850809 - display IBIGYR both sides of month, DH/DW
  468. X
  469. X      SUBROUTINE month
  470. XC (line)
  471. X
  472. Xc       Declarations:
  473. X
  474. X      include comdtc.INC
  475. X      include apptdtc.INC
  476. X      include escdtc.INC
  477. X
  478. X      INTEGER*1 TEMP
  479. X      Dimension TEMP(4)
  480. XC       temporary string converting array
  481. X      CHARACTER*4 TMPP
  482. X      EQUIVALENCE(TMPP,TEMP(1))
  483. X      Integer*4    id
  484. XC       Julian Day
  485. X      Integer*4  im
  486. XC       Julian Month
  487. X      Integer*4  iy
  488. XC       Julian Year
  489. X
  490. X      Integer*4  prveof, eofflg
  491. X
  492. Xc string month name
  493. X      INTEGER*1 monthn(9),
  494. X     1 lmonth(9)
  495. Xc Entries true if lenght of name is even
  496. X      logical*1 lmneven(12)
  497. Xc Entries true if length of name is odd
  498. X      logical*1 lmnodd(12)
  499. X
  500. X      INTEGER*1 out(79)
  501. XC       The output string and * array
  502. X        INTEGER*1 rchr
  503. XC       Flag set (or reset) character
  504. X      INTEGER*1 ln1
  505. XC       Same as line(1)
  506. X       include stmtfuncsp.for
  507. X      equivalence (line, ln1)
  508. X      Character*41 lxfmt
  509. X      Character*2 lxfixx,lxfixy
  510. X      Character*1 lxfc(41)
  511. X      Equivalence(lxfc(1),lxfmt)
  512. X      Equivalence (lxfixx,lxfc(14)),(lxfixy,lxfc(27))
  513. X      include comdtcd.inc
  514. X      include escdtcd.inc
  515. Xc 8      format(3a, 4(a1, x), <ixx>x, 9(x,a1), <ixy>x, 4(x, a1), $)
  516. Xc      write(iterm,8) ' ', esc,dhdw2, temp, monthn, temp
  517. Xc
  518. X      data lxfmt/'(7x,4(a1,2x),01x,9(2x,a1),01x,4(2x,a1),$)'/
  519. X      data lmneven/
  520. X     1 .false., .true., .false., .false., .false., .true.,
  521. X     2  .true., .true., .false., .false., .true.,  .true./
  522. Xc Entries true if length of name is odd
  523. X      data lmnodd
  524. X     1 /.true., .false., .true., .true.,  .true., .false.,
  525. X     2 .false., .false., .true., .true., .false., .false./
  526. X
  527. X      include stmtfunc.for
  528. X
  529. Xc Trim off the M from command line:
  530. X      if(ln1.gt.96)ln1=ln1-32
  531. X      if ((ln1 ) .eq. Ichar('M'))
  532. X     1 call shrink(1, ifnb, lnb)
  533. X
  534. X      call dtcdatcvt(2)
  535. XC Decode date string
  536. X
  537. X      im=idmo
  538. XC Pick up result from common
  539. X      id=iddy
  540. X      iy=ibigyr
  541. X
  542. X      call dtcidate(irm,ird,iry)
  543. XC Real month,day,year, for display highlight
  544. X
  545. Xc Move the cursor to the top part, clear the screen
  546. X
  547. X      write(iterm,600) esc,homescrn, esc,clrscrn
  548. X 600    format ($, 4a, $)
  549. X       Call Dtcat(1,1)
  550. Xc Now start building the output string: (out)
  551. X
  552. X      WRITE(TMPP,20,ERR=11)IY
  553. XC       encode(4, 20, temp, err=11) iy
  554. X 11     continue
  555. X 20     format(i4)
  556. X
  557. Xc Calculate nominal prev, next month numbers
  558. X
  559. X      lm = im - 1
  560. X      ly = iy
  561. X      nm = im + 1
  562. X      ny = iy
  563. X
  564. X      If ( im .eq. 1 ) then
  565. X
  566. X          lm = 12
  567. X          ly = iy - 1
  568. X
  569. X      else If ( im .eq. 12 ) then
  570. X
  571. X          nm = 1
  572. X          ny = iy + 1
  573. X
  574. X      End If
  575. X
  576. XC PRINT PREVIOUS MONTH
  577. X      call dtcmthnam(lm,lmonth)
  578. X
  579. XC PRINT NEXT MONTH CALENDAR AT TOP
  580. X      call dtcmthnam(nm,monthn)
  581. X
  582. XC WRITE OUT HDR FOR LAST, NEXT MONTH, THEN DAYS
  583. X      ix = 3
  584. X      if (lmneven(lm)) ix = ix + 1
  585. X      call dtcat(ix, 1)
  586. X      write(iterm,6) lmonth
  587. X      ix = 61
  588. X      if (lmneven(nm)) ix = ix + 1
  589. X      call dtcat(ix, 1)
  590. X      write(iterm,6) monthn
  591. X 6      format ($, 9(1a1, 1x))
  592. X      call dtcat(1, 2)
  593. X      write(iterm,7)
  594. X 7      format($,'Su Mo Tu We Th Fr Sa',
  595. X     1  T60,'Su Mo Tu We Th Fr Sa')
  596. Xc       call dtcat(35, 7)
  597. XC Center year above cur month
  598. Xc       write(iterm,96) temp
  599. Xc 96        format ('$', 4(x, a1))
  600. X
  601. Xc Now display last month, header for this month, and next month:
  602. X
  603. Xc Last month to upper-left corner of screen
  604. X
  605. X      call dtcalcdow(ib,il,lm,ly)
  606. X      call dtcdspmth(ib,il,0,0,-1,0)
  607. X      If ((irm .eq. lm) .and. (iry .eq. ly)) then
  608. XC today in rev video
  609. X          irdw = mod (ird + ib - 2, 7)
  610. XC Day of week (orig 0)
  611. X          irwk = (ird + ib - 2)/7
  612. XC Week in month (orig 0)
  613. X          call dtcat ((irdw*3) + 2, irwk + 3)
  614. X          write (iterm,684) esc,revattr, ird, esc,resetvattr
  615. X      end if
  616. X
  617. Xc Next month to upper-right corner of screen
  618. X
  619. X      call dtcalcdow(ib,il,nm,ny)
  620. X      call dtcdspmth(ib,il,58,0,-1,0)
  621. X      If ((irm .eq. nm) .and. (iry .eq. ny)) then
  622. XC today in rev video
  623. X          irdw = mod (ird + ib - 2, 7)
  624. XC Day of week (orig 0)
  625. X          irwk = (ird +ib - 2)/7
  626. XC Week in month (orig 0)
  627. Xc added 1 to x coord in dtcat for amiga fixup here and just above.
  628. X          call dtcat ((irdw*3) + 60, irwk + 3)
  629. X          write (iterm,684) esc,revattr, ird, esc,resetvattr
  630. X      end if
  631. X
  632. Xc               display big banner header name of this month:
  633. X
  634. Xc       call dtcat(ix,9)
  635. X      call dtcat(1,9)
  636. X
  637. X      call dtcmthnam(im,monthn)
  638. X
  639. X      ix = 11
  640. X      if (lmneven(im)) ix = ix + 1
  641. X      ixx = ix - 9
  642. X      ixy = 14 - ix
  643. X      ixx2=ixx+ixx
  644. X      ixy2=ixy+ixy
  645. Xc double spaces for single-wide char screen to emulate dbl wide char screen
  646. X       write(lxfixx,2220)ixx2
  647. X2220   format(i2.2)
  648. X       write(lxfixy,2220)ixy2
  649. X       write(iterm,lxfmt)temp,monthn,temp
  650. Xc       write(iterm,225)temp
  651. Xc 8      format(3a, 4(a1, x), <ixx>x, 9(x,a1), <ixy>x, 4(x, a1), $)
  652. Xc      write(iterm,8) ' ', esc,dhdw2, temp, monthn, temp
  653. X
  654. Xc Now print the week day headers for this month, and the days for this month:
  655. X
  656. X      call dtcat(1,11)
  657. X      write(iterm,10)
  658. X 10     format($,
  659. X     1 '  S u n      M o n     T u e s     W e d s   T h u r s',
  660. X     1 '       F r i       S a t')
  661. Xc          x     x     x     x     x     x     x     x
  662. X
  663. XC Mark double-width lines
  664. Xc      write (iterm,138)
  665. Xc     1 esc,'[13H', esc,dwide,
  666. Xc     2 esc,'[15H', esc,dwide,
  667. Xc     3 esc,'[17H', esc,dwide,
  668. Xc     4 esc,'[19H', esc,dwide,
  669. Xc     5 esc,'[21H', esc,dwide,
  670. Xc     6 esc,'[23H', esc,dwide
  671. X 138    format ($, 24a, $)
  672. Xc
  673. X        call dtcalcdow(ib,il,im,iy)
  674. X        call dtcdspmth(ib,il,8,8,9,1)
  675. XC For single-width
  676. Xc        call dtcdspmth(ib,il,1,3,9,1)
  677. XC For double-width
  678. Xc
  679. X        If ((irm .eq. im) .and. (iry .eq. iy)) then
  680. XC today in rev video
  681. Xc
  682. X          irdw = mod (ird + ib - 2, 7)
  683. XC Day of week (orig 0)
  684. X          irwk = (ird + ib - 2)/7
  685. XC Week in month (orig 0)
  686. X          call dtcat ((irdw*11)+9, (irwk*2)+13)
  687. X
  688. X          if (id .eq. ird) then
  689. X        write (iterm,684) esc,'[4;7m', ird, esc,resetvattr
  690. X          else
  691. X        write (iterm,684) esc,revattr, ird, esc,resetvattr
  692. X        go to 685
  693. XC And show looking-at date
  694. X          end if
  695. X
  696. X 684            format($, 2a, i2, 2a, $)
  697. X
  698. X       else
  699. X
  700. X 685        irdw = mod (id + ib - 2, 7)
  701. XC Day of week (orig 0)
  702. X          irwk = (id + ib - 2)/7
  703. XC Week in month (orig 0)
  704. X          call dtcat ((irdw*11)+9, (irwk*2)+13)
  705. X
  706. X          write (iterm,684) esc,'[4m', id, esc,resetvattr
  707. X
  708. X      end if
  709. X
  710. X      if (rdspfg .eq. 0) then
  711. X        rchr='*'
  712. X        out(1) = ' '
  713. X      else
  714. X        rchr=' '
  715. X        out(1) = '*'
  716. X      end if
  717. X
  718. X      Do (i= 2, 31)
  719. XC set the out array to all blanks:
  720. X      out(i) = out(1)
  721. X      end do
  722. X
  723. Xc Now for files I/O to put *'s on days with appointments:
  724. X
  725. X      irqhash(1) = ihymd(iy, im, 1)
  726. XC Want entries for
  727. X      irqhash(2) = ihymd(iy, im, 31)
  728. XC current month
  729. X
  730. X      eofflg = -1
  731. X      prveof = 0
  732. X
  733. X      do while (prveof .ge. 0)
  734. X
  735. X          call dtcrdappt(eofflg, 0)
  736. X          if (eofflg .ge. 0) out(ihd) = rchr
  737. X          prveof = eofflg
  738. X
  739. X      end do
  740. X
  741. Xc Have now accumulated all info about current month,
  742. Xc go back and flag appropriate days
  743. X
  744. X      iy = 13
  745. X      ip = ib - 1
  746. X
  747. X      Do (i=1,il)
  748. X
  749. X          ip = ip + 1
  750. XC       increment day number
  751. X          If ( ip .gt. 7 ) then
  752. XC       is it Sunday again?
  753. X        ip = 1
  754. XC       reset day to Sunday.
  755. X        iy = iy + 2
  756. XC       move down one line
  757. X          End If
  758. X
  759. X          if (out(i) .ne. 32) then
  760. XC Write only non-blank entries
  761. XC
  762. X               ix = 11 * ip - 4
  763. Xc        ix = 6 * ip - 5
  764. X        call dtcat(ix,iy)
  765. XC       position cursor
  766. X        write(iterm,231) out(i)
  767. XC       write * to screen
  768. X 231            format($,a1, $)
  769. X          end if
  770. X      end do
  771. XC # days in month
  772. X
  773. X 999    call dtcat(1,23)
  774. XC Position for next prompt
  775. X
  776. X      end
  777. XC -h- fnscan.for  Tue Jul  8 16:05:30 1986
  778. Xc subroutine FNSCAN - scan file-name record (999999999x<filespec>=)
  779. Xc and strip space, mark 0 at end of name
  780. X
  781. X      subroutine fnscan(work, maxlen, iwkln, ijr)
  782. X
  783. X      INTEGER*1 work(maxlen)
  784. X
  785. X      INTEGER*1 ll
  786. X
  787. X      ij = 0
  788. XC Initialize output index
  789. X      do (ii=1, min0(iwkln, maxlen))
  790. XC Start loop
  791. X          ll = work(ii)
  792. XC Get input character
  793. X          if (ll .gt. 32) then
  794. XC Strip all spaces & ctls
  795. X        if (ll .eq. ichar('=')) go to 10
  796. XC '=' marks end
  797. X        ij = ij + 1
  798. XC Character accepted
  799. X        work(ij) = ll
  800. XC Copy it
  801. X          end if
  802. XC (graphic character)
  803. X      end do
  804. XC Loop
  805. X
  806. X 10     work(min0(ij+1,maxlen)) = 0
  807. XC Set marker for OPEN
  808. X
  809. X      ijr = ij
  810. XC Return length of string
  811. X
  812. X      end
  813. XC -h- week.for    Tue Jul  8 16:05:58 1986
  814. Xc-----------------------------------------------------------------------
  815. XC       Week-at-a-glance subroutine
  816. XC       part of Mitch Wyle's DTC program
  817. XC       Input:
  818. Xc               line    -       72 INTEGER*1 string;  Format: W [mmddyy]
  819. XC       Output:
  820. Xc               display screen (see below)
  821. XC-----------------------------------------------------------------------
  822. XC       Modified 850117 to fix leap-year problems - CG
  823. Xc       Modified 850314 to use real corners, lines and T's for box - CG
  824. Xc       Modified 850318 to display current date in reverse video - CG
  825. Xc       Modified 850806 to use new subroutines (including DTCRDAPPT)
  826. Xc               and get rid of previously commented-out code
  827. Xc
  828. X      SUBROUTINE week
  829. XC (line)
  830. XC       Declarations:
  831. Xc
  832. X      include comdtc.INC
  833. X      include apptdtc.INC
  834. X      include escdtc.INC
  835. Xc
  836. X      INTEGER*1 ln1, ll
  837. XC       equiv to input line
  838. X      INTEGER*1 temp(2)
  839. XC       temporary string converting array
  840. X      logical apts(7,19), aptsln(133), tflg
  841. X      Integer*4  prveof, eofflg
  842. X      Integer*4  HASH
  843. X      Integer*4    id
  844. XC       Julian Day
  845. X      Integer*4  im
  846. XC       Julian Month
  847. X      Integer*4  iy, iyd
  848. XC       Julian Year
  849. X
  850. Xc lengths of months ... leap years adjusted in code
  851. Xc December Jan ... Dec Jan
  852. X      Integer*4  ml(14)
  853. X        include stmtfuncsp.for
  854. X      equivalence (line, ln1), (apts, aptsln)
  855. X       include comdtcd.inc
  856. X       include escdtcd.inc
  857. X      Data ml
  858. X     1 /31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31/
  859. X
  860. X      include stmtfunc.for
  861. X
  862. Xc       Initialize:
  863. X
  864. X      iss = z'7FFFFFFF'
  865. XC Impossible saved Sunday day...
  866. X      iwf=0
  867. XC Adjustment factor
  868. X
  869. X      if ((ln1 .and. ucmask) .eq. Ichar('W'))
  870. X     1 call shrink(1, ifnb, lnb)
  871. X
  872. X      call dtcidate(imx,idx,iyx)
  873. XC       initialize to today's date
  874. X
  875. X      call dtcdatcvt(3)
  876. XC       Get date string
  877. X
  878. X      im=idmo
  879. XC       Copy values
  880. X      id=iddy
  881. X      iy=ibigyr
  882. X
  883. X      if (islpyr(iy)) then
  884. X        ml(3)=29
  885. XC Feb is in ML(3), not ML(2)
  886. XC
  887. X          else
  888. X        ml(3)=28
  889. XC C Garman, 17-Jan-1985
  890. X      end if
  891. X
  892. XC Where we look for free space of n units or more length,
  893. XC then just display reverse and zot out all shorter periods
  894. X
  895. X      if (ctlfg .eq. 1) rdspfg=1
  896. X      tflg = (rdspfg .ne. 0)
  897. XC initialize flag
  898. X      do (ij = 1, 7*19)
  899. X          aptsln(ij) = tflg
  900. X      end do
  901. X
  902. X      if (ctlfg .ne. 0) then
  903. XC Locate N
  904. X
  905. X          intsz = 0
  906. X          i = 1
  907. X          do while(numeric(line(i)))
  908. X        intsz = (intsz * 10) + icvtbn1(line(i))
  909. X        i = i + 1
  910. X        if (i .gt. icmln) go to 1191
  911. X          end do
  912. X
  913. Xc clamp interval size to permissible range...
  914. X
  915. X 1191       intsz = min0(max0(intsz, 1), 18)
  916. X
  917. X       end if
  918. XC               Paint the screen:
  919. Xc
  920. X
  921. Xc following sequence moves to upper left corner on VT100 compatible terminals
  922. Xc and clears screen
  923. X
  924. X      write(iterm,6) esc,homescrn, esc,clrscrn
  925. X 6      format(1x,4a,$)
  926. X        call dtcat(1,1)
  927. Xc Now write box, in graphics mode, to enclose days of week
  928. X
  929. X      write (iterm, 70)  '+', '+'
  930. XC Upper corners & top line
  931. Xc
  932. X      irow=2
  933. X      Do (i = 1, 6)
  934. XC 6 more days' worth
  935. X      Call DtcAt(1,irow)
  936. X      irow=irow+1
  937. X          write (iterm, 71)
  938. X      Call DtcAt(1,irow)
  939. X      irow=irow+1
  940. X          write (iterm, 71)
  941. X      Call DtcAt(1,irow)
  942. X      irow=irow+1
  943. X          write (iterm, 72) 
  944. X      end do
  945. Xc
  946. X      Call DtcAt(1,irow)
  947. X      irow=irow+1
  948. X      write (iterm, 71) 
  949. X      Call DtcAt(1,irow)
  950. X      irow=irow+1
  951. X      write (iterm, 71) 
  952. XC two more sides
  953. X      Call DtcAt(1,irow)
  954. X      irow=irow+1
  955. X      write (iterm, 73)  '+', '+'
  956. XC Lower corners & bottom line
  957. Xc
  958. X 70     format (x, 1a1, 74('-'), 1a1)
  959. XC Upper/lower corners
  960. XC sides
  961. X 71     format (x,  '|', 74(' '), '|')
  962. X 72     format (x,  '+', 74('-'), '+')
  963. XC interior lines
  964. X 73     format (x, 1a1, 74('-'), 1a1)
  965. XC Upper/lower corne1rs
  966. X
  967. X      call dtcat(2,2)
  968. X      write(iterm,10) '   Sunday'
  969. X 10     format($,a)
  970. X      call dtcat(2,5)
  971. X      write(iterm,10) '   Monday'
  972. X      call dtcat(2,8)
  973. X      write(iterm,10) '  Tuesday'
  974. X      call dtcat(2,11)
  975. X      write(iterm,10) 'Wednesday'
  976. X      call dtcat(2,14)
  977. X      write(iterm,10) ' Thursday'
  978. X      call dtcat(2,17)
  979. X      write(iterm,10) '   Friday'
  980. X      call dtcat(2,20)
  981. X      write(iterm,10) ' Saturday'
  982. X
  983. XC       Now figure out which Sunday is closest to the day specified by id:
  984. Xc
  985. X
  986. X      call dtcalcdow(ib,il,im,iy)
  987. XC Remember: ib = 1st day of month
  988. X
  989. Xc il = length of month
  990. Xc ib = day number of 1st day of month, 1=sunday.
  991. X
  992. X      if ( ib .eq. 1 ) then
  993. X          is = 1
  994. XC IS is the Sunday we want.  It is
  995. X      else
  996. XC either the 1st day of the month
  997. X          is = 9 - ib
  998. XC or 9 - 1st day of month.
  999. X      end if
  1000. X
  1001. XC Now...Sunday may be in preceding month
  1002. X 11     continue
  1003. XC If the day is not in the 1st week
  1004. Xc try to fix up case of wrong sunday..
  1005. Xc ML array is preceding month's length
  1006. X      iwf=0
  1007. X      if (id .lt. is) then
  1008. X        is=is-7+ml(im)
  1009. X        im=im-1
  1010. X        if (im .le. 0) then
  1011. Xc adjust year wrapback
  1012. X                im=12
  1013. X                iy=iy-1
  1014. X        end if
  1015. X        il=ml(im+1)
  1016. X        iwf=-il
  1017. X        go to 301
  1018. X      end if
  1019. X      if ( ( id - is ) .ge. 7 ) then
  1020. XC of the month, then keep adding
  1021. X          is = is + 7
  1022. XC 7 until we get to the week we
  1023. X          go to 11
  1024. XC want.
  1025. X      end if
  1026. X 301    continue
  1027. Xc since we can wrap months down as well as up construct date limits here...
  1028. Xc ***   if (iy .gt. 1900) iy=iy-1900
  1029. Xc just generate a hashcode that is strictly increasing as a function of
  1030. Xc date. only purpose is to be monotonic increasing, so continuity is
  1031. Xc not important. we use other methods to handle exact offsets. note that
  1032. Xc where wrap arounds occur, iss is allowed to be a little larger than
  1033. Xc real month length or a small negative where used below...not here.
  1034. X
  1035. X      irqhash(1) = ihymd(iy, im, is)
  1036. X      iss = is
  1037. XC don't lose track of Sunday's date.
  1038. X      issss = is
  1039. XC It will be important later...
  1040. XC       Now figure out where to write the dates of the days of the week,
  1041. Xc       and write em out where they belong:
  1042. Xc
  1043. X      iyd = mod(iy, 100)
  1044. XC Display two digits
  1045. X
  1046. X      Do (i=1,7)
  1047. X          jy = 3 * i
  1048. X          call dtcat(2,jy)
  1049. X          if ((im .eq. imx) .and. (iy .eq. iyx)) then
  1050. X        if (is .eq. idx) then
  1051. X            if (id .eq. idx) then
  1052. XC reverse + underline
  1053. X                write(iterm,130,err=99)
  1054. X     1              esc,'[4;7m', im,is,iyd, esc,resetvattr
  1055. X            else
  1056. XC reverse only
  1057. X                write(iterm,130,err=99)
  1058. X     1              esc,revattr, im,is,iyd, esc,resetvattr
  1059. X            end if
  1060. X        else
  1061. X            go to 684
  1062. X        end if
  1063. X          else
  1064. X 684            if (is .eq. id) then
  1065. XC underline only
  1066. X            write(iterm,130,err=99)
  1067. X     1          esc,'[4m', im,is,iyd, esc,resetvattr
  1068. X        else
  1069. XC N/O/T/A, nothing fancy
  1070. X            write(iterm,13,err=99) im,is,iyd
  1071. X        end if
  1072. X          end if
  1073. X
  1074. X 99         is = is + 1
  1075. X          If ( is .gt. il ) then
  1076. XC Did the month change
  1077. X        is = 1
  1078. XC during this week?
  1079. X        im = im + 1
  1080. X        If ( im .gt. 12 ) then
  1081. XC Did the year change
  1082. X            im = 1
  1083. XC during this week?
  1084. X            iy = iy + 1
  1085. X            iyd = mod(iy, 100)
  1086. X        End If
  1087. X          End If
  1088. X
  1089. X      irqhash(2) = ihymd(iy, im, is)
  1090. XC save last day value in hash
  1091. X
  1092. X      end do
  1093. X
  1094. X 13     format($, i3, '/', i2.2,'/',i2.2)
  1095. X 130    format($, a1, a, i3, '/', i2.2,'/',i2.2, a1, a)
  1096. X
  1097. XC               Now for Files I/O:
  1098. Xc
  1099. X
  1100. Xc       Set up a boolean array of appointment times and days of
  1101. Xc       the week.  Notice that if this program were written in
  1102. Xc       assembler, we would use only 18 INTEGER*1s and store this
  1103. Xc       information by bits instead of INTEGER*1s.  Oh well.  There
  1104. Xc       goes 100 INTEGER*1s of storage space...
  1105. Xc       When life confronts you with its troubles and woes,
  1106. Xc       Have no fear, just fire photon torpedos
  1107. XC
  1108. X
  1109. XC       Read the appointments; If the appointment is for one of
  1110. Xc       the days in this week, mark that spot in the appointments
  1111. Xc       array true.  Otherwise that coordinate is false.  The array
  1112. Xc       looks like this:
  1113. XC               Su Mo Tu We Th Fr Sa
  1114. XC       8:00     T  F  F  F  F  F  F
  1115. XC Appointment on Su at 8:00
  1116. Xc       8:30     F  T  T  T  F  F  F
  1117. XC Appointments on Mo, Tu, We at 8:30
  1118. Xc       9:00     F  F  F  F  F  F  F
  1119. XC No appointments at 9:00 this week
  1120. Xc       9:30
  1121. XC        .       .  .  .  .  .  .  .
  1122. Xc        .       .  .  .  .  .  .  .            etcetera
  1123. Xc        .       .  .  .  .  .  .  .
  1124. Xc
  1125. XC sic itur ad astra
  1126. XC       Etcetra.  Caveat emptor and three other latin words.
  1127. XC
  1128. X      prveof = 0
  1129. X      eofflg = -1
  1130. X
  1131. X      do while (prveof .ge. 0)
  1132. X
  1133. X          call dtcrdappt(eofflg, 0)
  1134. XC Look at appointments file
  1135. X
  1136. X          if (eofflg .ge. 0)
  1137. X     1     then
  1138. X
  1139. XC NOW we are testing the date range validly. However, we must adjust
  1140. XC the ISS range to be in the range from - (small #) to +
  1141. XC (or some such) to take into account the fact that it MUST be
  1142. XC continuous in order to be transformed into a cursor address.
  1143. XC FORTUNATELY we saved the appropriate length of month adjustment
  1144. XC above so can add it back in here.  IWF=0 most times.
  1145. X
  1146. X        iss=issss+iwf
  1147. X        jx = ihd - iss + 1
  1148. XC need a little more logic to handle crossing months here
  1149. Xc where jx >7 we have to adjust by length of month once more...
  1150. X        if (jx .gt. 7) jx=jx+iwf
  1151. Xc also have to handle cases where we crossed months, by adding in
  1152. Xc length of previous month.
  1153. X        if (jx .le. 0) jx=jx+ml(im)
  1154. X        jy = min0(max0(((iht+2)/5)-15, 1), 19)
  1155. X
  1156. X        if ((jx .ge. 1) .and. (jx .le. 7) .and.
  1157. X     1      (jy .ge. 1) .and. (jy .le. 19))
  1158. X     2    then
  1159. X
  1160. X            apts(jx,jy) = .not. tflg
  1161. XC Derived a long time ago
  1162. XC
  1163. X
  1164. X       end if
  1165. X
  1166. X          end if
  1167. X
  1168. X          prveof = eofflg
  1169. X
  1170. X      end do
  1171. XC while
  1172. XC               Now display the information we have extracted:
  1173. Xc
  1174. X      if (ctlfg .ne. 0) then
  1175. Xc here go through and look for "intsz" sized intervals and
  1176. Xc set apts(i,j) to .false. if the interval is too small...
  1177. X          k=19-intsz
  1178. X          Do (i=1,7)
  1179. X        Do (j=1,k)
  1180. X            ivl=1
  1181. X            Do (l=1,intsz)
  1182. X                if (.not. apts(i,j+l-1)) ivl=0
  1183. X            end do
  1184. X            if (ivl .ne. 1) apts(i,j)= .false.
  1185. X        end do
  1186. Xc since we are showing valid start times, set all times at the end of
  1187. Xc the day false since they can't possibly be valid times for any
  1188. Xc meetings.
  1189. X        kk=k+1
  1190. X        if (kk .le. 18) then
  1191. X            do (j=kk,18)
  1192. X                apts(i,j)= .false.
  1193. X            end do
  1194. X        end if
  1195. X          end do
  1196. X      End If
  1197. X
  1198. X      Do (i=1,7)
  1199. XC Go through the entire
  1200. X          Do (j=1,19)
  1201. XC array and display
  1202. X        If ( apts(i,j) ) then
  1203. XC appts if they exist:
  1204. X            jx = 6 * j + 10
  1205. XC jx is x coord of cursor
  1206. X            jy = 3 * i - 1
  1207. XC jy is y coord of cursor
  1208. X
  1209. X            If ( jx .gt. 74) then
  1210. XC For afternoon and evening
  1211. X                jy = jy + 1
  1212. XC appointments, put the
  1213. X                jx = jx - 63
  1214. XC appointments on the second
  1215. X            End If
  1216. XC line of the day
  1217. X
  1218. X            jj = j
  1219. XC Now decode the time again
  1220. X            call dtcat(jx,jy)
  1221. XC to display.  jj is time
  1222. X            if (((j/2)*2) .ne. j) then
  1223. XC of appointment
  1224. X                jj = jj + 7 - (jj/2)
  1225. XC If the time is odd then
  1226. X                write(iterm,16) jj
  1227. XC it falls on the hour.
  1228. X 16                     format($,i2,':00')
  1229. X            else
  1230. X                jj = jj + 7 - (jj/2)
  1231. XC If the time is even then
  1232. X                write(iterm,17) jj
  1233. XC it falls on the half hour
  1234. X 17                     format($,i2,':30')
  1235. X            end if
  1236. X        End If
  1237. X          end do
  1238. X      end do
  1239. X
  1240. X 999    call dtcat(1,22)
  1241. XC move cursor to the bottom
  1242. X      end
  1243. XC of the screen and return
  1244. XC -h- year.for    Tue Jul  8 16:06:21 1986
  1245. Xc-----------------------------------------------------------------------
  1246. XC       Year-at-a-glance subroutine
  1247. XC       part of Mitch Wyle's DTC program
  1248. XC       Input:
  1249. Xc               line    -       72 INTEGER*1 string;  Format: Y [yy]
  1250. XC       Output:
  1251. Xc               display screen (see below)
  1252. XC-----------------------------------------------------------------------
  1253. Xc
  1254. X
  1255. X      SUBROUTINE year
  1256. XC (line)
  1257. X
  1258. Xc Declarations:
  1259. X
  1260. X      include comdtc.INC
  1261. X      include escdtc.INC
  1262. X
  1263. X      INTEGER*1 temp(4), ln1
  1264. X      Character*4 tempc
  1265. X      Equivalence(tempc,temp(1))
  1266. X      Character*2 tempc2
  1267. X      Equivalence(tempc2,temp(1))
  1268. XC       temporary string converting array
  1269. X
  1270. X      Integer*4    id, idr
  1271. XC       Julian Day
  1272. X      Integer*4 im, imr
  1273. XC       Julian Month
  1274. X      Integer*4 iye, iyr
  1275. XC       Julian Year
  1276. X      Integer*4 iyo
  1277. XC       y offset for where to put month data
  1278. X      Integer*4   ix
  1279. XC       x coord of cursor
  1280. X      Integer*4 iy
  1281. XC       y coord of cursor
  1282. X      Integer*4   img
  1283. XC       month loop index goes from 1 to 12
  1284. X      Integer*4   jg
  1285. XC       index offset defined by img
  1286. X      Integer*4 ii
  1287. XC       implied do loop index variable
  1288. X      INTEGER*1 monthn(9)
  1289. XC       string month name
  1290. X      real badf77
  1291. X      real badftn
  1292. XC       Maybe error in array subscripts
  1293. Xc string containing names of days of week
  1294. X      character*21 wknam
  1295. XC       Hoolay kan
  1296. X      INTEGER*1 ihold
  1297. XC       hold the screen
  1298. X
  1299. Xc Entries true if length of name is even
  1300. X      logical*1 lmneven(12)
  1301. X
  1302. X      equivalence (line, ln1)
  1303. X       include comdtcd.inc
  1304. X       include escdtcd.inc
  1305. X      Data wknam
  1306. X     1 / 'Su Mo Tu We Th Fr Sa|'/
  1307. X      Data lmneven/
  1308. X     1 .false., .true., .false., .false., .false., .true.,
  1309. X     2  .true., .true., .false., .false., .true.,  .true./
  1310. X
  1311. X
  1312. X      if ((ln1 .and. ucmask) .eq. ichar('Y'))
  1313. X     1 call shrink(1, ifnb, lnb)
  1314. X
  1315. X      call dtcdatcvt(1)
  1316. XC       Parse out a year value
  1317. X
  1318. X      im=idmo
  1319. X      id=iddy
  1320. X      iye=ibigyr
  1321. Xc
  1322. X      call dtcidate(imr,idr,iyr)
  1323. XC       initialize to today's date
  1324. X
  1325. XC       to display in reverse video
  1326. X
  1327. Xc set screen to 132 col, double width for 
  1328. X    write(iterm,300) esc,'[0;0H',esc,'[1J'
  1329. XC Erase screen first in this mode...
  1330. X      write(iterm,300) esc,'[?3h',
  1331. X     1 esc,'[2H', esc,'#6',
  1332. X     2 esc,'[14H', esc,'#6'
  1333. XC Month headers
  1334. X      Write(tempc,20,err=97)iye
  1335. Xc      encode (4, 20, temp, err=97) iye
  1336. X 20     format(i4)
  1337. X
  1338. X 97     ix = 29
  1339. X      iy = 11
  1340. X      call dtcat(ix,iy)
  1341. XC Display year in
  1342. X      write(iterm,305) esc,dhdw1, temp
  1343. XC double height/double width
  1344. Xc *******&&&& ??????
  1345. XC in the middle of the screen
  1346. X      iy = 12
  1347. X      call dtcat(ix,iy)
  1348. X      write(iterm,305) esc,dhdw2, temp
  1349. XC second line
  1350. X
  1351. X 99     Do 4 img = 1,12
  1352. XC       for each month:
  1353. X          call dtcmthnam(img,monthn)
  1354. XC       Find out name, and display it
  1355. X          jg = img - 1
  1356. XC       x coord of cursor for month
  1357. X          if (jg .gt. 5) jg = jg - 6
  1358. XC       name in outstring
  1359. X          ix = ( jg * 22 ) + 1
  1360. XC
  1361. X          if (img .gt. 6) then
  1362. XC       First six months on top
  1363. X        iy = 14
  1364. XC       last six months on bottom
  1365. X          else
  1366. XC       half of screen
  1367. X        iy = 2
  1368. X          end if
  1369. Xc          ixx = (ix/2) + 2
  1370. Xc ***       if (lmneven(img)) ixx = ixx + 1
  1371. X    call dtcat(ix,iy)
  1372. Xc          call dtcat(ixx,iy)
  1373. XC       Position cursor and:
  1374. X          write(iterm,3) monthn
  1375. X 3          format($,21a1)
  1376. XC       Write out the name.
  1377. X 300        format($,40a)
  1378. X 305        format($, 2a, 4(x, a))
  1379. X 399        format($,a21)
  1380. XC       Write out the name.
  1381. X          If (img .gt. 6) then
  1382. XC       Write out day of week
  1383. X        iy = 15
  1384. XC       Header names also, one
  1385. X          else
  1386. XC       line below month names
  1387. X        iy = 3
  1388. X          end if
  1389. X          call dtcat(ix,iy)
  1390. X          write(iterm,399) wknam
  1391. X
  1392. X          If (img .gt. 6) then
  1393. XC       Write out numbers for
  1394. X        iy = 15
  1395. XC       Days in each month:
  1396. X        iyo = 12
  1397. X          else
  1398. X        iy = 4
  1399. X        iyo = 0
  1400. X          end if
  1401. X          call dtcalcdow(ib,il,img,iye)
  1402. XC       Now position the month
  1403. X          ix = ix - 1
  1404. XC       Off by 1.  CORRECT IT
  1405. X          ixspa = 0
  1406. X          ixo   = 0
  1407. X          iyspa = 0
  1408. X          call dtcdspmth(ib,il,ix,ixspa,iyo,iyspa)
  1409. X
  1410. Xc If displaying current year, mark today's date in reverse video
  1411. X
  1412. X          if ((iye .eq. iyr) .and. (img .eq. imr)) then
  1413. X        idw = mod(ib + idr -2, 7)
  1414. XC Day of week and
  1415. X        iwm = (idr + ib - 2)/7
  1416. XC week of month (orig 0)
  1417. X        if (img .gt. 6) iwm = iwm + 1
  1418. XC Down one more line for Jul-Dec
  1419. X        call dtcat((idw * 3) + ix + 1, iy + iwm)
  1420. X        write (iterm, 301) esc,'[5;7m', idr, esc,resetvattr
  1421. X 301            format ($, 2a, i2, 2a, $)
  1422. X          end  if
  1423. X 4      Continue
  1424. X
  1425. X      call dtcat (1,23)
  1426. XC Reposition cursor
  1427. X
  1428. Xc return next line read in and allow main pgm to decode...
  1429. X    Rewind 7
  1430. X      read(7,80,END=914)line
  1431. X    Rewind 7
  1432. X 80     format(84a1)
  1433. X 914    Continue
  1434. X    Rewind 7
  1435. X    write(iterm,300) esc,'[?3l'
  1436. X    Rewind 7
  1437. X    Return
  1438. X      end
  1439. XC -h- strip.for   Tue Jul  8 16:06:45 1986
  1440. Xc-----------------------------------------------------------------------
  1441. XC       Strip Daily Appointment subroutine (DTC Purge command)
  1442. XC       part of GLENN EVERHART'S MODS TO DTC program
  1443. XC       Input: command line - 72 INTEGER*1s, format:
  1444. XC               P [mmddyy]
  1445. Xc                    or
  1446. Xc               U [mmddyy] [hh:mm[>hh:mm]]
  1447. Xc                    or
  1448. Xc               X [mmddyy] [hh:mm[>hh:mm]] [mmddyy] [hh:mm[>hh:mm]]
  1449. XC       Output:
  1450. Xc               Reads dtc.dat, and builds new dtc.dat, in the process
  1451. Xc       strips old appointments (before date) from file (P),
  1452. Xc       deletes appointments at specified time and date (U),
  1453. Xc       or re-schedules (eXchanges) appointments from d1*t1 to d2*t2
  1454. Xc for Amiga, since we don't have version numbers, build DTC.TMP and
  1455. Xc copy onto DTC.DAT (or whatever) later...
  1456. XC-----------------------------------------------------------------------
  1457. Xc
  1458. X
  1459. X      SUBROUTINE strip
  1460. XC (line)
  1461. X
  1462. XC       Declarations:
  1463. Xc
  1464. X      include comdtc.INC
  1465. X      include apptdtc.INC
  1466. Xc
  1467. XC       Function constants: Purge
  1468. XC       .. Unschedule
  1469. X      parameter (idspp = 1)
  1470. X      Parameter (idspu = 2)
  1471. X      Parameter (idspx = 3)
  1472. XC       .. eXchange
  1473. XC       INTEGER*1 line(1)
  1474. XC       input line
  1475. XC       temporary string converting array
  1476. X      INTEGER*1 temp(2), ll,
  1477. X     1 ln1, ap1
  1478. XC       For RDAPPT 'do while' loop
  1479. X      Integer*4 eofflg, prveof,
  1480. X     1  firstflg
  1481. X      Integer*4   id, idx
  1482. XC       Julian Day
  1483. X      Integer*4 im, imx
  1484. XC       Julian Month
  1485. X      Integer*4 iye, iyx
  1486. XC       Julian Year
  1487. X      Integer*4 it1, it2, itx1, itx2
  1488. XC time values 80 (8 AM) => 173 (5:30 PM)
  1489. Xc
  1490. X      logical first
  1491. XC       For X decode
  1492. X       Character*1 ln1c
  1493. X       equivalence (line, ln1)
  1494. Xc      equivalence (appoin, ap1)
  1495. X       Equivalence (ln1,ln1c)
  1496. X       include stmtfuncsp.for
  1497. X       include comdtcd.inc
  1498. Xc
  1499. X      include stmtfunc.for
  1500. XC Get standard statement functions
  1501. X
  1502. Xc Parse input line:
  1503. Xc       Was there a P on the front?  If so, trim it off:
  1504. Xc
  1505. X
  1506. X    iopn2=0
  1507. Xc flag we opened DTC.TMP, 1 if true...
  1508. X      isavinc = incmod
  1509. XC Save for increment in DATCVT
  1510. X
  1511. X      first = .true.
  1512. XC Set it regardless of path
  1513. X
  1514. X      If ( ln1c .eq. 'P' ) then
  1515. X
  1516. X          idisp = idspp
  1517. XC Function to perform
  1518. X
  1519. X      else
  1520. X
  1521. X          if (ln1c .eq. 'U') then
  1522. X        idisp = idspu
  1523. X          else if (ln1c .eq. 'X') then
  1524. X        idisp = idspx
  1525. X          else
  1526. X        go to 999
  1527. XC Error, can't decode it
  1528. X          end if
  1529. X
  1530. X          it1 = 80
  1531. XC Set comparison values
  1532. X          it2 = 180
  1533. END_OF_FILE
  1534. if test 37896 -ne `wc -c <'Dtc.For.ab'`; then
  1535.     echo shar: \"'Dtc.For.ab'\" unpacked with wrong size!
  1536. fi
  1537. # end of 'Dtc.For.ab'
  1538. fi
  1539. echo shar: End of archive 4 \(of 6\).
  1540. cp /dev/null ark4isdone
  1541. MISSING=""
  1542. for I in 1 2 3 4 5 6 ; do
  1543.     if test ! -f ark${I}isdone ; then
  1544.     MISSING="${MISSING} ${I}"
  1545.     fi
  1546. done
  1547. if test "${MISSING}" = "" ; then
  1548.     echo You have unpacked all 6 archives.
  1549.     rm -f ark[1-9]isdone
  1550. else
  1551.     echo You still need to unpack the following archives:
  1552.     echo "        " ${MISSING}
  1553. fi
  1554. ##  End of shell archive.
  1555. exit 0
  1556. -- 
  1557. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  1558. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  1559. Post requests for sources, and general discussion to comp.sys.amiga.
  1560.